#include <iostream>

using namespace std;


class Solution
{
public:
    int MLS(vector<int>& arr)
    {
        int n = arr.size();
        if (n == 1) return 1;

        sort(arr.begin(), arr.end());


        int len = 0, maxlen = 0;
        for (int i = 1; i < n; i++)
        {
            if (arr[i] == arr[i - 1] + 1)
            {
                len++;
            }
            else
            {
                len = 0;
            }
            maxlen = max(maxlen, len + 1);
        }

        return maxlen;
    }
};

int main()
{
    return 0;
}